<?php
namespace app\common\validate;

use think\Validate;

class ServiceValidate extends Validate
{
    protected $rule =   [
        'id'                       => 'require|integer',
        'user_id|用户ID'           => 'require|integer',
        'page|页数'                => 'require|integer',
        'limit|条数'               => 'require|integer',
        'name|名称'                => 'require|length:1,50',
        'address|地址'             => 'require|length:1,255',
        'site_layout|场地布局'     => 'require|length:1,500',
        'staffing|人员配置'        => 'require|length:1,500',
        'edu_img|学历证'           => 'require',
        'qua_img|资格证'           => 'require',
        'site_head_img|场地门面照' => 'require',
        'interior_img|室内布局照'  => 'require',
    ];
    
    protected $scene = [
        /** api */
        'add'   => ['user_id', 'name', 'address', 'site_layout', 'staffing', 'edu_img', 'qua_img', 'site_head_img', 'interior_img'],

        /** admin */
        'list'       => ['page', 'limit'],
        'admin_show' => ['id'],
        'admin_back' => ['id', 'back_msg'],
    ];
}